package edu.whut.mall.common.util;

import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.codec.CodecSupport;
import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

/**
 * @program: d9lab-mall
 * @description: MD5加密
 * @author: Wayne
 * @create: 2020-04-17 17:54
 **/
public class Md5Util {
    private static final String ALGORITH_NAME = "md5";

    public static final int HASH_ITERATIONS = 5;

    public static String encrypt(String password) {
        return new SimpleHash(ALGORITH_NAME, password, null, HASH_ITERATIONS).toHex();
    }
}
